package com.example.demo.thread.create;

/**
 * @author MarioZzz
 * @create 2023-10-24 18:34
 */
public class MainB {
    public static void main(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
        thread.start();
    }
}

/**
 * 2 实现Runnable接口，重写run方法
 */
class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("实现Runnable接口，重写run方法");
    }
}
